﻿@model IRuleExpression

@{
    var metadata = Model.Descriptor.Metadata;
    var id = "rule-value-" + Model.Id;
    var min = metadata.Get("min") as double?;
    var max = metadata.Get("max") as double?;
    var step = metadata.Get("step") as double?;
    var decimals = (metadata.Get("decimals") as uint?) ?? 4;
}

@*INFO: onRuleValueChanged (enables save button) called by handler in smartstore.rules.js.*@
<input type="number"
       id="@id"
       name="@id"
       value="@Model.RawValue"
       sm-decimals="@decimals"
       sm-postfix="@metadata.Get("postfix")"
       placeholder="@T("Common.Empty")"
       min="@min"
       max="@max"
       attr-step='(step > 0, step?.ToStringInvariant())'
       class="form-control" />